<template>
	<view class="padding">
		<view class="text-white" style="padding-top: 150upx;">
			<view class="text-center">
				<view class="text-sl">{{`${data.totalScore}分`}}</view>
				<view class="padding-top-xs">本次考试成绩</view>
			</view>
			<view class="flex justify-around text-center" style="padding-top: 120upx;">
				<view>
					<view class="text-xxl">{{`${data.accuracyRate}%`}}</view>
					<view class="padding-top-xs">正确率</view>
				</view>
				<view>
					<view class="text-xxl">{{`${data.examDuration}分钟`}}</view>
					<view class="padding-top-xs">考试用时</view>
				</view>
				<view>
					<view class="text-xxl">{{`${data.totalWrong}题`}}</view>
					<view class="padding-top-xs">错题数</view>
				</view>
			</view>
		</view>
		<view  style="padding-top: 600upx;" class="flex justify-center" @click="toPage('/pages/work/exams/index')">
			<view class="bg-white flex justify-center align-center text-lg text-bold" style="width: 90%;color: #2699FB;height: 100upx;border-radius: 10upx;">
				返回主页
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		onLoad(options) {
			this.data.totalScore = options.totalScore
			this.data.accuracyRate = (options.accuracyRate * 100).toFixed(0)
			this.data.examDuration = options.examDuration
			this.data.totalWrong = options.totalWrong
		},
		data() {
			return {
				data: {
					totalScore: 0,
					accuracyRate: 0,
					examDuration: 0,
					totalWrong: 0
				}
			}
		},
		methods:{
			toPage(url){
				window.location.replace('/pages/work/index');
			}
		}
	}
</script>

<style>
	page {
		background-color: #2699FB;
	}

	.bottom {
		position: relative;
		bottom: 0;

	}
</style>